/****************************************************************


******************************************************************/

#ifndef SRC_USER_USER_MACRO_H_
#define SRC_USER_USER_MACRO_H_


#define  NVIC_VECTAB_OFFSET   0x8000

#define HARDWARE_VERSION      100
#define SOFTWARE_VERSION      104

#define SOFTWARE_VERSION_NUM  360
#define HARDWARE_VERSION_NUM  300

#define PROJECT_REMARK_STR    "Release"

#define EN_SCI_DATA_PLOT      0
#define EN_SCI_DATA_PRINTF    1

// --------------------- Hall sensor GPIO define --------------------
#define GPIO_NUM_M2_HALL_A    31
#define GPIO_NUM_M2_HALL_B    34
#define GPIO_NUM_M2_HALL_C    12

#define READ_M2_HALL_A   
#define READ_M2_HALL_B   
#define READ_M2_HALL_C   


// ------------------- Main Power relay GPIO define -------------------
#define GPIO_NUM_MAINRELAY    40
#define GPIO_NUM_DRIVER       39

#define ENABLE_MAINRELAY      
#define DISABLE_MAINRELAY     

#define ENABLE_DRIVER         
#define DISABLE_DRIVER        

#define GPIO_NUM_LED4             23
#define LED_BLK_STATE_IDLE        100*5
#define LED_BLK_STATE_ONLINE      50*5
#define LED_BLK_STATE_PERCHARGE   70*5
#define LED_BLK_STATE_OFFLINE     200*5
#define LED_BLK_STATE_WARN        20*5
#define LED_BLK_STATE_FAULT       20*5
#define LED_BLK_STATE_ADJUST      200*5

// ---------------------- system state machine ----------------------
#define FSM_STATE_IDLE            0
#define FSM_STATE_ONLINE          1
#define FSM_STATE_OFFLINE         2
#define FSM_STATE_FAULT           3
#define FSM_STATE_CHECK           4
#define FSM_STATE_PRECHARGE       5
#define FSM_STATE_ACTDISCHARGE    6

#define FSM_STATE_ADJUST          8



#endif /* SRC_USER_USER_MACRO_H_ */
